import request from '@/utils/request'

// 查询所有有效设备类型
export function listEffectiveDeviceType() {
  return request({
    url: '/device/deviceType/all',
    method: 'get'
  })
}

// 单击获取表格数据
export function listPreserveCheck(query) {
  return request({
    url: '/device/preserveCheck/list',
    method: 'get',
    params: query
  })
}

// 根据Id获取数据
export function getByIdPreserveCheck(bnlId) {
  return request({
    url: '/device/preserveCheck/getById/' + bnlId,
    method: 'get'
  })
}

// 新增表格数据
export function addPreserveCheck(data) {
  return request({
    url: '/device/preserveCheck',
    method: 'post',
    data: data
  })
}

// 修改表格数据
export function editPreserveCheck(data) {
  return request({
    url: '/device/preserveCheck',
    method: 'put',
    data: data
  })
}

// 删除表格数据
export function deletePreserveCheck(bnlId) {
  return request({
    url: '/device/preserveCheck/' + bnlId,
    method: 'delete'
  })
}

// 导出设备数据
export function exportPreserveCheck(query) {
  return request({
    url: '/device/preserveCheck/export',
    method: 'get',
    params: query
  })
}

// 修改状态
export function changedPreserveCheckFlag(bnlId, bnlFlag) {

  const data = {
    bnlId,
    bnlFlag
  }
  return request({
    url: '/device/preserveCheck',
    method: 'put',
    data: data
  })
}
